<app-dialog-component [title]="title$ | async" (okEmitter)="clickedConvertToTeam()"
                      [formGroup]="chooseStructure"
                      [saveAndCloseLabel]= "saveAndCloseLabel$ | async">
  <form [formGroup]="chooseStructure">
    <mat-form-field class="form-whole-line">
      <mat-select placeholder="{{ 'convert-topic-draft-to-team.form.select' | translate }}" formControlName="parentUnitId">
        <mat-optgroup *ngFor="let company of companyStructures$ | async" [label]="company.name">
          <ng-container *ngFor="let childUnit of company.substructures">
            <mat-option [value]="childUnit.id">{{childUnit.name}}</mat-option>
          </ng-container>
        </mat-optgroup>
      </mat-select>
    </mat-form-field>
  </form>
</app-dialog-component>

